/*
 * @Author: lokei
 * @Date: 2022-10-23 18:07:51
 * @LastEditors: lokei
 * @LastEditTime: 2022-10-24 08:28:03
 * @Description: 
 */
package cn.lokei.task.entity.iot.mqtt;

 
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttMessage;
 
public class MqttReceriveCallback implements MqttCallback {
    
 
	@Override
	public void connectionLost(Throwable cause) {
		
	}
 
	@Override
	public void messageArrived(String topic, MqttMessage message) throws Exception {
		 System.out.println("Client 接收消息主题 : " + topic);
	     System.out.println("Client 接收消息Qos : " + message.getQos());
	     System.out.println("Client 接收消息内容 : " + new String(message.getPayload()));
	    
	    
	}
 
	@Override
	public void deliveryComplete(IMqttDeliveryToken token) {
		
	}

}
